function StartNode(context, activity) {
    activity.context = context;
    activity.defaultStyle = {
        fill: "#AA0000",
        stroke: "#FF0000",
        "opacity": 0
    };
    
    var iconName = context.command == "R" ? "start" : context.command == "U" ? "normal" : context.command == "E" ? "end" : context.command == "F" ? "fork" : context.command == "J" ? "join" : context.command == "D" ? "decision" : context.command == "S" ? "forkNormal" : context.command == "M" ? "joinNormal" : "";
    var colorName =  activity.visitedFlag == "VISITED" ? "/red" : activity.visitedFlag == "UN_VISITED" ? "/blue" : "/black";
    activity.view = context.paper.image("ui/workflow/css/images" + colorName + "/icon-" + iconName + ".png", activity.x || context.x, activity.y ||
    context.y, activity.width || 60, activity.height || 60);

    var name = activity.alias;
//    if (activity.alias) {
//        name = name + "[" + activity.alias + "]";
//    }
    activity.viewText = context.paper.text((activity.x || context.x) + 30, (activity.y || context.y) + 70, name);
    activity.viewText.attr({ "font-size": 16, "font-family": "Arial, Helvetica, sans-serif", "font-weight": "bold"});
    activity.view.data = activity;
    
	if (!context.readOnly) {
		$(activity.view.node).contextMenu({
			menu: 'activityMenu'
		}, function(action, el, pos) {
			g_dx, g_dy = 0;
			if (action == "delete") {
				activity.view.remove();
				activity.viewText.remove();
				this.context.removeActivity(activity);
				// 删除活动对应路由
				var transitions = this.context.getTransitionOfActivity(activity);
				for (var i = 0; i < transitions.startActivityList.length; i++) {
					transitions.startActivityList[i].remove();
					this.context.removeTransition(transitions.startActivityList[i]);
				}
				for (var i = 0; i < transitions.endActivityList.length; i++) {
					transitions.endActivityList[i].remove();
					this.context.removeTransition(transitions.endActivityList[i]);
				}
			} else {
				this.context.menuClick("activity", action, activity);
			}
		});
	}
    
    activity.updateTransition = function(dx, dy) {
        var transitions = this.context.getTransitionOfActivity(this);
        for (var i = 0; i < transitions.startActivityList.length; i++) {
            transitions.startActivityList[i].moveStartXY(dx, dy);
        }
        for (var i = 0; i < transitions.endActivityList.length; i++) {
            transitions.endActivityList[i].moveEndXY(dx, dy);
        }
        
    };
    /*activity.view.hover(function(event) {
     var x = (event.offsetX || event.layerX || 0) - this.attr("x");
     var y = (event.offsetY || event.layerY || 0) - this.attr("y");
     var width = this.attr("width") / 3;
     var height = this.attr("height") / 3;
     if ((x < width) && (y < height)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.topLeft.show();
     } else if ((x < width) && (y < height * 2)) {
     this.data.hotPoint.hide();
     this.data.hotPoint.middleLeft.attr(this.data.defaultStyle);
     //this.data.hotPoint.middleLeft.show();
     } else if ((x < width) && (y > height * 2)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.bottomLeft.show();
     } else if ((x < width * 2) && (y < height * 2)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.topMiddle.show();
     } else if ((x < width * 2) && (y > height * 2)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.bottomMiddle.show();
     } else if ((x > width * 2) && (y < height)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.topRight.show();
     } else if ((x > width * 2) && (y < height * 2)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.middleRight.show();
     } else if ((x > width * 2) && (y > height * 2)) {
     this.data.hotPoint.hide();
     //this.data.hotPoint.bottomRight.show();
     }
     //this.data.hotPoint.show();
     }, function() {
     this.data.hotPoint.hide();
     });*/
    activity.dragCtl = context.paper.set();
    activity.dragCtl.push(activity.view);
    activity.dragCtl[0].update = function(dx, dy) {
    
        this.attr({
            x: this.attr("x") + dx,
            y: this.attr("y") + dy
        });
        
        this.data.viewText.attr({
            x: this.data.viewText.attr("x") + dx,
            y: this.data.viewText.attr("y") + dy
        });
        
        this.data.updateTransition(dx, dy);
        this.data.hotPoint.updateMove(dx, dy);
        updateXY(activity);
    };
    
    activity.dragCtl.drag(nodeMoveEvent, nodeMoveStartEvent, nodeMoveEndEvent);
    activity.hotPoint = new HotPoint(activity);
    activity.hotPoint.hide();
    
    activity.view.mousedown(function(event) {
        context.removeTransitionHotPoint();
        context.rightClickFlag = event.button == 2 ? true : false;
        if (!context.rightClickFlag) {
            HotPoint_CreateTransition(activity.hotPoint.middleRight);
        }
        if (context.readOnly) {
			context.objClick(event, "activity", activity);
		}
    });
    
    activity.view.mouseup(function(event) {
    
    });
    
    activity.view.mouseover(function(event) {
    	if (context.readOnly) {
    		context.objMouseover(event, "activity", activity);
    	}
    });

    activity.view.mouseout(function(event) {
    	if (context.readOnly) {
    		context.objMouseout(event, "activity", activity);
    	}
    });
};

StartNode.prototype.getData = function() {
    return this.view.data;
};

StartNode.prototype.updateProperty = function() {
    alert(1);
};
